'use strict';
/**
 * Created by zhouzhongyuan on 2016/1/6.
 */
define(function () {
    var logger              = function (level) {
        this.level  = level;
    };
    logger.LEVEL_DEBUG      = 0;
    logger.LEVEL_INFO       = 1;
    logger.LEVEL_WARN       = 2;
    logger.LEVEL_ERROR      = 3;

    logger.prototype        = {
        log        : function (s) {
            this.message(100, s);
        },
        debug      : function (s) {
            this.message(logger.LEVEL_DEBUG, s);
        },
        info       : function (s) {
            this.message(logger.LEVEL_INFO, s);
        },
        warn       : function (s) {
            this.message(logger.LEVEL_WARN, s);
        },
        error      : function (s) {
            this.message(logger.LEVEL_ERROR, s);
        },
        message    : function (level, s) {
            if (level >= this.level) {
                console.log(s);
            }
        }
    };
    if (typeof window.Logger == 'undefined' || window.Logger == null) {
        window.Logger = new logger(logger.LEVEL_DEBUG);
        return window.Logger;
    }else {
        return window.Logger;
    }
});